package com.taxi.driver.module.vo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.taxi.driver.data.entity.CommonStarCountDtoEntity;
import com.taxi.driver.data.entity.EvaluateEntity;

import java.util.List;

/**
 * 评价
 */
public class EvaluationVO {

    public static EvaluationVO createFrom(EvaluateEntity entity) {
        if (entity == null) return new EvaluationVO();
        String strJson = JSON.toJSONString(entity);
        return JSON.parseObject(strJson, EvaluationVO.class);
    }

    @JSONField(name = "scoreOfRecent")
    public double averageScore;//平均分

    @JSONField(name = "score")
    public double cumulativeScore;//累计得分

    @JSONField(name = "orderCount")
    public int cumulativeOrder;//累计接单数

    @JSONField(name = "commonStarCountDto")
    public CommonStarCountDtoEntity commonStarCountDto;//星级评价

    @JSONField(name = "evaluates")
    public List<TagVO> tags;//标签
}
